<%@ page language="java" contentType="text/html; charset=UTF-8" pageEncoding="UTF-8"%>
<%@ include file="/WEB-INF/page/inc/taglib.jsp"%>
<div class="pageHeader">
	<form id="pagerForm" onsubmit="return navTabSearch(this);" action="${pageContext.request.contextPath}/shopOrder/orders/list" method="post">
		<!-- 分页表单参数 -->
		<%@include file="/WEB-INF/page/inc/pageForm.jsp"%>
		<!-- 需要排序的字段 -->
		<input type="hidden" name="orderField" value="${requestScope.dwzPageBean.countResultMap.orderField}" />
		<!-- 正序倒序 -->
		<input type="hidden" name="orderDirection" value="${requestScope.dwzPageBean.countResultMap.orderDirection}" />
		<div class="searchBar">
			<table class="searchContent">
				<tr>
					<%-- <td>订单编号：<input type="text" name="orderNum" value="${requestScope.dwzPageBean.countResultMap.orderNum}" placeholder="输入订单编号" /></td> --%>
					<td>销售单编号：
						<input size="30" placeholder="请输入订单编号" name="org2.orderNum" type="text" postField="orderNum" suggestFields="orderNum" 
						suggestUrl="${pageContext.request.contextPath}/shopOrder/orders/getOrderNum" lookupGroup="org2" 
						value="${requestScope.dwzPageBean.countResultMap.orderNum}" />
					</td>
					<%-- <td>店铺名称：<input type="text" name="shopName" value="${requestScope.dwzPageBean.countResultMap.shopName}" placeholder="输入会员名称" /></td> --%>
					<td>店铺名称：
						<input size="30" placeholder="请输入店铺名称" name="org2.shopName" type="text" postField="shopName" suggestFields="shopName" 
						suggestUrl="${pageContext.request.contextPath}/shopOrder/orders/getShopName" lookupGroup="org2" 
						value="${requestScope.dwzPageBean.countResultMap.shopName}" />
					</td>
					<td>下单时间：<input name="startTime" class="date textInput readonly" readonly="true" type="text" value="${requestScope.dwzPageBean.countResultMap.startTime}" placeholder="请输入下单时间" style="margin-right: 5px;">
					至<input style="margin-left: 5px;" name="endTime" class="date textInput readonly" readonly="true" type="text" value="${requestScope.dwzPageBean.countResultMap.endTime}" placeholder="请输入下单时间"></td>
				</tr>
			</table>
			<div class="subBar">
				<ul>
					<li>
						<div class="buttonActive">
							<div class="buttonContent">
								<button type="submit">查询</button>
							</div>
						</div>
					</li>
				</ul>
			</div>
		</div>
	</form>
</div>
<div class="pageContent">
	<div class="panelBar">
	<ul class="toolBar">
			<shiro:hasPermission name="/shopOrder/orders/export">
				<li><a href="${pageContext.request.contextPath}/shopOrder/orders/export" target="dwzExport" targetType="navTab" title="确定要导出这些记录吗?" class="icon"><span>导出EXCEL</span></a></li>
			</shiro:hasPermission>
		</ul>
	</div>
	<table class="table" targetType="navTab" asc="asc" desc="desc" width="100%" layoutH="138">
		<thead>
			<tr>
				<th orderField="shopName" <c:if test="${requestScope.dwzPageBean.countResultMap.orderField == 'shopName'}">class="${requestScope.dwzPageBean.countResultMap.orderDirection}"</c:if>>店铺名称</th>
				<th orderField="order_num" <c:if test="${requestScope.dwzPageBean.countResultMap.orderField == 'order_num'}">class="${requestScope.dwzPageBean.countResultMap.orderDirection}"</c:if>>销售单编号</th>
				<th orderField="basketCount" <c:if test="${requestScope.dwzPageBean.countResultMap.orderField == 'basketCount'}">class="${requestScope.dwzPageBean.countResultMap.orderDirection}"</c:if>>商品数量</th>
				<th orderField="order_money" <c:if test="${requestScope.dwzPageBean.countResultMap.orderField == 'order_money'}">class="${requestScope.dwzPageBean.countResultMap.orderDirection}"</c:if>>销售单金额</th>
				<th orderField="real_money" <c:if test="${requestScope.dwzPageBean.countResultMap.orderField == 'real_money'}">class="${requestScope.dwzPageBean.countResultMap.orderDirection}"</c:if>>实收金额</th>
				<th orderField=activityName <c:if test="${requestScope.dwzPageBean.countResultMap.orderField == 'activityName'}">class="${requestScope.dwzPageBean.countResultMap.orderDirection}"</c:if>>活动名</th>
				<th orderField="activity_reduce_money" <c:if test="${requestScope.dwzPageBean.countResultMap.orderField == 'activity_reduce_money'}">class="${requestScope.dwzPageBean.countResultMap.orderDirection}"</c:if>>活动优惠金额</th>
				<th orderField="memberName" <c:if test="${requestScope.dwzPageBean.countResultMap.orderField == 'memberName'}">class="${requestScope.dwzPageBean.countResultMap.orderDirection}"</c:if>>会员名称</th>
				<th orderField="memberNum" <c:if test="${requestScope.dwzPageBean.countResultMap.orderField == 'memberNum'}">class="${requestScope.dwzPageBean.countResultMap.orderDirection}"</c:if>>会员号</th>
				<th orderField="add_time" <c:if test="${requestScope.dwzPageBean.countResultMap.orderField == 'add_time'}">class="${requestScope.dwzPageBean.countResultMap.orderDirection}"</c:if>>下单时间</th>
				<th orderField="order_process" <c:if test="${requestScope.dwzPageBean.countResultMap.orderField == 'order_process'}">class="${requestScope.dwzPageBean.countResultMap.orderDirection}"</c:if>>销售单状态</th>
				<th orderField="guider" <c:if test="${requestScope.dwzPageBean.countResultMap.orderField == 'guider'}">class="${requestScope.dwzPageBean.countResultMap.orderDirection}"</c:if>>导购员</th>
			</tr>
		</thead>
		<tbody>
				<c:if test="${requestScope.dwzPageBean != null &&  requestScope.dwzPageBean.recordList != null }">
					<c:forEach var="record" items="${requestScope.dwzPageBean.recordList}" varStatus="status">
						<tr >
							<td>${record.shopName}</td>
							<td>${record.orderNum}</td>
							<td>${record.basketCount}</td>
							<td>${record.orderMoney*0.01}</td>
							<td>${record.realMoney*0.01}</td>
							<td>${record.activityName}</td>
							<td>${record.activityReduceMoney*0.01}</td>
							<td>${record.memberName}</td>
							<td>${record.memberNum}</td>
							<td><fmt:formatDate pattern="yyyy-MM-dd" value="${record.addTime}" /></td>
							<td>${record.orderProcess == 0 ? '新订单': ''}${record.orderProcess == 1 ? '已受理': ''}${record.orderProcess == 2 ? '待收货': ''}${record.orderProcess == 6 ? '退款中': ''}${record.orderProcess == 7 ? '已退货': ''}${record.orderProcess == 8 ? '取消订单': ''}${record.orderProcess == 9 ? '完成': ''}</td>
							<td>${record.guider}</td>
						</tr>
					</c:forEach>
				</c:if>
		</tbody>
	</table>
	<!-- 分页条 -->
	<%@include file="/WEB-INF/page/inc/pageBar.jsp"%>
</div>